package com.vhall.component.controller.rbac;


import com.vhall.component.controller.rbac.facade.RbacMenuFacade;
import com.vhall.component.entity.rbac.vo.*;
import com.vhall.component.framework.common.annotation.VhallComponent;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import com.vhall.component.service.rbac.RbacMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;

import java.util.List;

/**
 * @author dalong
 * @date 2021-05-12 21:05
 */
@TokenAuth
@VhallComponent
@Api(tags = "RbacMenuController", value = "菜单")
public class RbacMenuController implements RbacMenuFacade {

    @Autowired
    private RbacMenuService menuService;

    @ApiOperation("菜单-列表")
    @Override
    public List list(@Validated MenuListReqVO reqVO) {
        return menuService.getList(reqVO);
    }

    @ApiOperation("菜单-添加")
    @Override
    public MenuesVO add(@Validated MenuAddReqVO reqVO) {
        return menuService.add(reqVO);
    }

    @ApiOperation("菜单-删除")
    @Override
    public List<Integer> delete(@Validated MenuDeleteReqVO reqVO) {
        return menuService.batchDelete(reqVO);
    }

    @ApiOperation("菜单-编辑")
    @Override
    public Boolean edit(@Validated MenuEditReqVO reqVO) {
        return menuService.edit(reqVO);
    }

}
